#pragma once
#include "sceneobject.h"
#include "Color4.h"
#include "Ray.h"
#include "Geometry.h"

class CLight :
	public CSceneObject
{
public:
	CLight(void);
	virtual ~CLight(void);

	void Init(const CVector3D& vPosition, DATA_TYPE fAmbient, const CColor4& vColor);
	virtual CColor4 Shade(const CRay& vRay, const CVector3D& vPoint, const CVector3D& vNormal, const CGeometry& geometry, bool bInShadow) const = 0;
	virtual CRay GetRayToLightAndDistance(const CVector3D& vPoint, DATA_TYPE& fDistance) const;

	DATA_TYPE GetAmbient() const { return m_fAmbient; }
	const CColor4& GetColor() const { return m_vColor; }

protected:
	DATA_TYPE m_fAmbient;
	CColor4 m_vColor;
};

typedef boost::shared_ptr<CLight> CLightPtr;